<html>
<head>
	<meta http-equiv="Content-Type" content="text/html;charset=UTF-8">
	<title>Document</title>
</head>
<body>
	<h1>我的第一段JavaScript</h1>
	<p>请输入数字。如果输入值不是数字，浏览器会弹出提示框。</p>
    <input type="text" name="text" id="demo">
    <script type="text/javascript">
    	function myFunction(){
    		var x=document.getElementById('demo').value;
    		if (x==""||isNaN(x)) {
    			alert("Not Numeric");
    		}
    	}
    </script>
    <button type="button" onclick="myFunction()">点击这里</button>
</body>
</html>